package com.darren.center.shardingjdbc.demo.service.impl;

import com.darren.center.shardingjdbc.demo.entity.Orders;
import com.darren.center.shardingjdbc.demo.mapper.OrdersMapper;
import com.darren.center.shardingjdbc.demo.service.IOrderService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Author: 01403292
 * Date: 2021-08-05 15:35:50
 * Version: 1.0
 * Description:
 */
@Service
public class OrderServiceImpl implements IOrderService {

    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public PageInfo<Orders> queryOrderListByPage(Orders order) {
        PageHelper.startPage(order.getCurrentPage(), order.getPageSize(),true);
        List<Orders> orders = ordersMapper.queryOrderListByPage(order);
        return new PageInfo<>(orders);
    }
}
